package com.kila.dao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

public class JdbcTemplateTest {


    //创建增加数据表
    public static void maintest(){
        ApplicationContext applicationContext =
                new ClassPathXmlApplicationContext("applicationContext.xml");
        //引用jdbcTemplate IOC容器对象
        JdbcTemplate temp = (JdbcTemplate) applicationContext.getBean("jdbcTemplate");
        //通过excute("String SQLcommand") 通过该方法内写入SQL语句
        temp.execute("CREATE TABLE account("+
                        "id INT PRIMARY KEY AUTO_INCREMENT,"+
                        "username VARCHAR(50),"+
                        "balance DOUBLE)");

        System.out.println("账户创建完成执行");
    }


    public static void addAcound(){

    }


    public static void main(String[] args){

//        maintest();

    }
}
